package com.ruoyi.comn.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import com.ruoyi.common.core.utils.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.comn.mapper.ComnDeptGroupMapper;
import com.ruoyi.comn.domain.ComnDeptGroup;
import com.ruoyi.comn.service.IComnDeptGroupService;

/**
 * 部门分组Service业务层处理
 * 
 * @author ruoyi
 * @date 2021-11-30
 */
@Service
public class ComnDeptGroupServiceImpl implements IComnDeptGroupService 
{
    @Autowired
    private ComnDeptGroupMapper comnDeptGroupMapper;

    /**
     * 查询部门分组
     * 
     * @param deptGroupUuid 部门分组主键
     * @return 部门分组
     */
    @Override
    public ComnDeptGroup selectComnDeptGroupByDeptGroupUuid(String deptGroupUuid)
    {
        return comnDeptGroupMapper.selectComnDeptGroupByDeptGroupUuid(deptGroupUuid);
    }

    /**
     * 查询部门分组列表
     * 
     * @param comnDeptGroup 部门分组
     * @return 部门分组
     */
    @Override
    public List<ComnDeptGroup> selectComnDeptGroupList(ComnDeptGroup comnDeptGroup)
    {
        return comnDeptGroupMapper.selectComnDeptGroupList(comnDeptGroup);
    }

    /**
     * 新增部门分组
     * 
     * @param comnDeptGroup 部门分组
     * @return 结果
     */
    @Override
    public int insertComnDeptGroup(ComnDeptGroup comnDeptGroup)
    {
        comnDeptGroup.setCreateBy(SecurityUtils.getUsername());
        comnDeptGroup.setCreateTime(DateUtils.getNowDate());
        return comnDeptGroupMapper.insertComnDeptGroup(comnDeptGroup);
    }

    /**
     * 修改部门分组
     * 
     * @param comnDeptGroup 部门分组
     * @return 结果
     */
    @Override
    public int updateComnDeptGroup(ComnDeptGroup comnDeptGroup)
    {
        comnDeptGroup.setUpdateBy(SecurityUtils.getUsername());
        comnDeptGroup.setUpdateTime(DateUtils.getNowDate());
        return comnDeptGroupMapper.updateComnDeptGroup(comnDeptGroup);
    }

    /**
     * 批量删除部门分组
     * 
     * @param deptGroupUuids 需要删除的部门分组主键
     * @return 结果
     */
    @Override
    public int deleteComnDeptGroupByDeptGroupUuids(String[] deptGroupUuids)
    {
        return comnDeptGroupMapper.deleteComnDeptGroupByDeptGroupUuids(deptGroupUuids);
    }

    /**
     * 删除部门分组信息
     * 
     * @param deptGroupUuid 部门分组主键
     * @return 结果
     */
    @Override
    public int deleteComnDeptGroupByDeptGroupUuid(String deptGroupUuid)
    {
        return comnDeptGroupMapper.deleteComnDeptGroupByDeptGroupUuid(deptGroupUuid);
    }
}
